package com.example.databasedoc.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * Result
 *
 * @author lijunsong
 * @date 2021/4/26 19:02
 * @since 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class Result {

    private int code;
    private String message;

    /**
     * 请求失败
     *
     * @param code
     * @param message
     * @return
     */
    public static Result failure(int code, String message) {
        return new Result(code, message);
    }

    /**
     * 请求成功
     *
     * @param code
     * @param message
     * @return
     */
    public static Result success(int code, String message) {
        return new Result(code, message);
    }

}
